/*
 * @Author: ZWS
 * @Date: 2022-01-17 16:09:09
 * @LastEditTime: 2022-02-12 16:00:27
 * @Description: 公共函数
 */

// 防抖

export function antiShake (fn: any, delayed: number): any {
  let timer: NodeJS.Timeout
  return () => {
    window.clearTimeout(timer)
    timer = setTimeout(() => {
      fn()
    }, delayed)
  }
}
